﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;

namespace DAO
{
    public class LoaiKH_DAO
    {

        private DataProvider _provider = new DataProvider();

        public LoaiKH_DAO()
        {
            _provider.connect();
        }
        public DataTable GetTableLoaiKH()
        {
            string s = "Select * from LoaiKH order by MaLoaiKH DESC";
            return _provider.executeQuery(s);
        }
        public int proc_Ins_LoaiKH(LoaiKH_DTO dto)
        {
            return _provider.proc_Ins_LoaiKH(dto);
        }
        public void XoaLoaiKH(string MaLKH)
        {
            string s = "DELETE FROM LoaiKH WHERE MaLoaiKH='" + MaLKH + "'"  ;
            _provider.executeNonQuey(s);
        }
        public void SuaLoaiKH(string MaLKH, string TenLKH)
        {
            string s = "UPDATE LoaiKH SET TenLoaiKH=N'" + TenLKH + "'WHERE MaLoaiKH='" + MaLKH + "'";
            _provider.executeNonQuey(s);

        }
    }
        
}

